<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use DB;

class Worklinkwelcome extends Model
{
    protected $table = 'work_link_welcome';
    protected $primaryKey = 'id';

    public static function workLinkWelcome($kfid)
    {
        return self::where("kfid",$kfid)->first();
    }

    public static function createWorkLinkWelcome($kfid,$msg_type,$msgContent)
    {
        return self::insert(["kfid"=>$kfid,"msg_type"=>$msg_type,"msg_content"=>$msgContent,"created_at"=>time()]);
    }

    public static function updateWorkLinkWelcome($kfid,$msg_type,$msgContent)
    {
        return self::where("kfid",$kfid)->update(["msg_type"=>$msg_type,"msg_content"=>$msgContent]);
    }
}
